package com.ruanyun.modular.admin.mapper;

import com.ruanyun.modular.admin.entity.TBasicMaterial;
import com.ruanyun.modular.admin.entity.TExhaustEquipment;
import com.ruanyun.modular.admin.model.params.TExhaustEquipmentParam;
import com.ruanyun.modular.admin.model.result.TBasicMaterialResult;
import com.ruanyun.modular.admin.model.result.TExhaustEquipmentResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 废气治理设施 Mapper 接口
 * </p>
 *
 * @author 
 * @since 2021-04-17
 */
@Repository
public interface TExhaustEquipmentMapper extends BaseMapper<TExhaustEquipment> {

    /**
     * 获取列表
     *
     * @author 
     * @Date 2021-04-17
     */
    List<TExhaustEquipmentResult> customList(@Param("paramCondition") TExhaustEquipmentParam paramCondition);

    /**
     * 获取map列表
     *
     * @author 
     * @Date 2021-04-17
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TExhaustEquipmentParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author 
     * @Date 2021-04-17
     */
    Page<TExhaustEquipmentResult> customPageList(@Param("page") Page page, @Param("paramCondition") TExhaustEquipmentParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author 
     * @Date 2021-04-17
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TExhaustEquipmentParam paramCondition);

    Page<TExhaustEquipmentResult> customPageList1(@Param("page") Page page, @Param("paramCondition") TExhaustEquipmentParam paramCondition);


    /*根据companyId 查询是否存在数据*/
    @Select("SELECT * FROM t_exhaust_equipment WHERE company_id = #{companyId}  and del_flag != 2 ")
    List<TExhaustEquipment> getDetails(@Param("companyId")Long companyId);

    @Select("select * from t_exhaust_equipment where id = #{id}")
    TExhaustEquipmentResult getDetail(@Param("id") Integer id);

    Page<TExhaustEquipmentResult> getExhaustEquipmentPage(@Param("pageContext") Page pageContext, @Param("companyId") Integer companyId);


    @Select("SELECT * FROM t_exhaust_equipment WHERE company_id = #{companyId}  and del_flag != 2 ")
    List<TExhaustEquipmentResult>  getExhaustEquipmentList(@Param("companyId") Integer companyId);

}
